package com.kurumi.medical.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.kurumi.medical.util.StringUtil;
/**
 * 检验报告记录
 * @author lyh
 *
 */
public class HospitalVisitExaminationReportsRecord {

	/**
	 * 报告单标题
	 */
	private String title;
	
	/**
	 * 患者
	 */
	private String patientName;
	
	/**
	 * 科别名称
	 */
	private String deptCategoryName;
	
	/**
	 * 样品编号
	 */
	private String specimenCode;
	
	/**
	 * 性别名称
	 */
	private String sexName;
	
	/**
	 * 床位名称
	 */
	private String bedName;
	
	/**
	 * 条码编号
	 */
	private String barCode;
	
	/**
	 * 年龄
	 */
	private String ageName;
	
	/**
	 * 费别
	 */
	private String costName;
	
	/**
	 * 标本种类名称
	 */
	private String specimenTypeName;
	
	/**
	 * 病案号
	 */
	private String mrId;
	
	/**
	 * 送检医师
	 */
	private String submittingPhysicianName;
	
	/**
	 * 临床诊断名称
	 */
	private String clinicalDiagnosisName;
	
	/**
	 * 采样时间
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date samplingDateTime;
	
	/**
	 * 送检时间
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date inspectDateTime;
	
	/**
	 * 检验者名称
	 */
	private String inspectionDoctorName;
	
	/**
	 * 核收时间
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date acceptanceCheckDateTime;
	
	/**
	 * 报告时间
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date reportDateTime;
	
	/**
	 * 审核者名称
	 */
	private String auditorDoctorName;
	
	/**
	 * 备注
	 */
	private String remark;
	
	/**
	 * 检验报告项集合
	 */
	private List<HospitalVisitExaminationReportsItem> examinationReportsItems = new ArrayList<HospitalVisitExaminationReportsItem>();

	@JsonIgnore
	public void clearEmpty(){
		for (int i = this.examinationReportsItems.size()-1; i >=0; i--) {
			HospitalVisitExaminationReportsItem examinationReportsItem = this.examinationReportsItems.get(i);
			if(examinationReportsItem.isEmpty()){
				this.examinationReportsItems.remove(i);
			}
		}
	}
	
	@JsonIgnore
    public boolean isEmpty(){
    	if(this.getPatientName() == null && this.getDeptCategoryName() == null
    			&& this.getSexName() == null && this.getBedName() == null
    			&& this.getMrId() == null){
    		return true;
    	}
    	return false;
    }
	
	public String getTitle() {
		return StringUtil.meaningStr(title);
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPatientName() {
		return StringUtil.meaningStr(patientName);
	}

	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}

	public String getDeptCategoryName() {
		return StringUtil.meaningStr(deptCategoryName);
	}

	public void setDeptCategoryName(String deptCategoryName) {
		this.deptCategoryName = deptCategoryName;
	}

	public String getSpecimenCode() {
		return StringUtil.meaningStr(specimenCode);
	}

	public void setSpecimenCode(String specimenCode) {
		this.specimenCode = specimenCode;
	}

	public String getSexName() {
		return StringUtil.meaningStr(sexName);
	}

	public void setSexName(String sexName) {
		this.sexName = sexName;
	}

	public String getBedName() {
		return StringUtil.meaningStr(bedName);
	}

	public void setBedName(String bedName) {
		this.bedName = bedName;
	}

	public String getBarCode() {
		return StringUtil.meaningStr(barCode);
	}

	public void setBarCode(String barCode) {
		this.barCode = barCode;
	}

	public String getAgeName() {
		return StringUtil.meaningStr(ageName);
	}

	public void setAgeName(String ageName) {
		this.ageName = ageName;
	}

	public String getCostName() {
		return StringUtil.meaningStr(costName);
	}

	public void setCostName(String costName) {
		this.costName = costName;
	}

	public String getSpecimenTypeName() {
		return StringUtil.meaningStr(specimenTypeName);
	}

	public void setSpecimenTypeName(String specimenTypeName) {
		this.specimenTypeName = specimenTypeName;
	}

	public String getMrId() {
		return StringUtil.meaningStr(mrId);
	}

	public void setMrId(String mrId) {
		this.mrId = mrId;
	}

	public String getSubmittingPhysicianName() {
		return StringUtil.meaningStr(submittingPhysicianName);
	}

	public void setSubmittingPhysicianName(String submittingPhysicianName) {
		this.submittingPhysicianName = submittingPhysicianName;
	}

	public String getClinicalDiagnosisName() {
		return StringUtil.meaningStr(clinicalDiagnosisName);
	}

	public void setClinicalDiagnosisName(String clinicalDiagnosisName) {
		this.clinicalDiagnosisName = clinicalDiagnosisName;
	}

	public Date getSamplingDateTime() {
		return samplingDateTime;
	}

	public void setSamplingDateTime(Date samplingDateTime) {
		this.samplingDateTime = samplingDateTime;
	}

	public Date getInspectDateTime() {
		return inspectDateTime;
	}

	public void setInspectDateTime(Date inspectDateTime) {
		this.inspectDateTime = inspectDateTime;
	}

	public String getInspectionDoctorName() {
		return inspectionDoctorName;
	}

	public void setInspectionDoctorName(String inspectionDoctorName) {
		this.inspectionDoctorName = inspectionDoctorName;
	}

	public Date getAcceptanceCheckDateTime() {
		return acceptanceCheckDateTime;
	}

	public void setAcceptanceCheckDateTime(Date acceptanceCheckDateTime) {
		this.acceptanceCheckDateTime = acceptanceCheckDateTime;
	}

	public Date getReportDateTime() {
		return reportDateTime;
	}

	public void setReportDateTime(Date reportDateTime) {
		this.reportDateTime = reportDateTime;
	}

	public String getAuditorDoctorName() {
		return auditorDoctorName;
	}

	public void setAuditorDoctorName(String auditorDoctorName) {
		this.auditorDoctorName = auditorDoctorName;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public List<HospitalVisitExaminationReportsItem> getExaminationReportsItems() {
		return examinationReportsItems;
	}

	public void setExaminationReportsItems(
			List<HospitalVisitExaminationReportsItem> examinationReportsItems) {
		this.examinationReportsItems = examinationReportsItems;
	}

	@Override
	public String toString() {
		return "HospitalVisitExaminationReportsRecord [title=" + title + ", patientName=" + patientName
				+ ", deptCategoryName=" + deptCategoryName + ", specimenCode=" + specimenCode + ", sexName=" + sexName
				+ ", bedName=" + bedName + ", barCode=" + barCode + ", ageName=" + ageName + ", costName=" + costName
				+ ", specimenTypeName=" + specimenTypeName + ", mrId=" + mrId + ", submittingPhysicianName="
				+ submittingPhysicianName + ", clinicalDiagnosisName=" + clinicalDiagnosisName + ", samplingDateTime="
				+ samplingDateTime + ", inspectDateTime=" + inspectDateTime + ", inspectionDoctorName="
				+ inspectionDoctorName + ", acceptanceCheckDateTime=" + acceptanceCheckDateTime + ", reportDateTime="
				+ reportDateTime + ", auditorDoctorName=" + auditorDoctorName + ", remark=" + remark
				+ ", examinationReportsItems=" + examinationReportsItems + "]";
	}
	
	
	
	
}
